package day1;

public class Person/* extends Object */{
	// 私有的属性和方法，只在当前类访问到
	// 被protected修饰的属性和方法，子类可以继承，在子类里面可以访问到
	protected int id;
	protected String name;
	protected int age;
	protected String gender;
	
	public Person() {
		super();
	}

	public Person(int id, String name, int age, String gender) {
		super();
		this.id = id;
		this.name = name;
		this.age = age;
		this.gender = gender;
	}
	
	public void show() {
		System.out.println("id: " + id + ", name: " + name);
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public String getGender() {
		return gender;
	}

	public void setGender(String gender) {
		this.gender = gender;
	}

	@Override
	public String toString() {
		return "Person [id=" + id + ", name=" + name + ", age=" + age + ", gender=" + gender + "]";
	}

}
